<?php
require_once 'config.php';
$keyword = getValue('keywordsearch','str','POST',getValue('keywordsearch','str','GET',''));
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <link type="image/x-icon" href="/favicon.ico" rel="icon" />
   
   <title>Tìm kiếm từ khóa: <?=$keyword?></title>
   <meta name="description" content="Kết quả tìm kiếm cho từ khóa <?=$keyword?>"/>
   <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>
   <?=$global_meta;?>
   <!-- css -->   
   <link rel="stylesheet" type="text/css" href="/home/css/home.css" />	
   <link rel="stylesheet" type="text/css" href="/home/css/service.css" />
   <!-- js -->
   <script type="text/javascript" src="/home/js/jquery-1.9.0.min.js"></script>
   <script type="text/javascript" src="<?=TEMPLATE_PATH?>js/common.js"></script>
</head>
<body> 
   <div class="global_container">
      <? include('view/common/vic_header.php')?>
      <div class="content_wrap">
         <div class="cumbs_wrap">
            <div class="crumbs width">
               <ul>              
            		<li><a href="/">Trang chủ </a> &nbsp;>&nbsp; </li>
                  <li><a href="#">Tìm kiếm</a> &nbsp;>&nbsp; </li>
                  <li><a href="#"><?=$keyword?></a></li>
            	</ul>
            </div>
         </div>
         <div class="content_inner width">
            <div class="content_left">
               <?include('view/common/vic_content_left.php')?>               
            </div>
            <div class="content_right">
               <div class="services_wrap">              
                  <?php
                     if($keyword == '') {
                        echo 'Không tìm thấy từ khóa';
                  }
                     else {
                     $services = db_array('SELECT *
                                        FROM   services 
                                        WHERE ser_active = 1 AND ser_title LIKE "%'.replaceMQ($keyword).'%" 
                                        ORDER BY ser_id DESC 
                                        LIMIT 30');
                     
                     ?>
                        <?php if(count($services) > 0):?>
                        <h2 style="padding: 10px 0px;">Kết quả tìm kiếm cho từ khóa : <?=$keyword?></h2>
                        <?
                           if($services){
                           foreach($services as $row){
                        ?>
                           <div class="post_one">
                              <div class="image_post">
                                 <img src="<?=services_img.$row['ser_picture']?>"/>
                              </div>
                              <div class="post_info">
                                 <a href="<?=generate_service_detail_url($row)?>"><p class="post_title"><?=$row['ser_title']?> </p></a>
                                 <p class="post_date"><?=getDateTime(1,1,1,1,'',$row['ser_date'])?></p>
                                 <div class="post_description"><?=cut_string($row['ser_summary'],200)?>... <a href="<?=generate_service_detail_url($row)?>">Đọc thiêm</a></div>
                              </div>
                           </div>
                        <?
                           }}else echo "Chưa có dịch vụ!"
                        ?>
                        <?php else:?>
                        <h2 style="padding: 10px 0px;">Không tìm thấy kết quả nào cho từ khóa : <?=$keyword?></h2>
                        <?php endif;?>
                     <?
                     }
                     ?>
               </div>
            </div>
         </div>
         <div class="clear"></div>
      </div>
      <div class="clear"></div>
      <?include('view/common/vic_footer.php')?>
   </div>
</body>
</html>